package com.ganbo.demo.controller;

import com.ganbo.demo.entity.UserInnodb;
import com.ganbo.demo.mapper.UserInnodbMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ganbo
 * @date 2022/10/19 10:27
 */

@RestController
public class IndexController {

    private int i;

    @GetMapping("/getI")
    public int getI() {
        i++;
        return i;
    }




    @Autowired
    RedisTemplate redisTemplate;

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @Autowired
    UserInnodbMapper userInnodbMapper;

    @GetMapping("/hello11")
    public void testFindALL() {
        List<UserInnodb> all = userInnodbMapper.findAll();
        System.out.println("size====>" + all.size());

    }
}
